import { defineComponent } from 'vue'
import { vNodeTransformDom } from '@/utils/common/vudeofunction'

export function videoPlayer(item: any) {
  const component = defineComponent({
    name: 'ChildProps',
    setup(props) {
      // const { attribute } = item
      // // const videoSrc = `https://180.101.238.36:8081/qxhldz/icvs2/stream.flv?puid=32011127001310230053&idx=0&stream=0&token=YihDp_B1JY7A8rOvy-5x8A-GSXXHKMpH`
      const videoSrc = `http://${window.location.host}/easy-player/videoIndex.html?videosrc=${item.videoStream}` // const videoSrc = `https://klxxcdn.oss-cn-hangzhou.aliyuncs.com/histudy/hrm/media/bg1.mp4`
      return () => (
        <>
          <div className='z-30 w-600px h-450px ' style=' background: rgba(28, 28, 28, 0.4);'>
            <iframe className='z-30' src={videoSrc} frameBorder='0' width='600px' height='450px' />
          </div>
        </>
      )
    },
  })

  return {
    components: component,
    outHTML: vNodeTransformDom(component, false),
  }
}
